package io.renren.utils;

/**
 * @className: DataSourceContextHolder
 * @program: renren-generator
 * @description: 数据库切换类
 * @author: wzp12
 * @create: 2019-06-03 22:46
 **/
public class DataSourceContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static synchronized void setDBType(String dbType){
        contextHolder.set(dbType);
    }

    public static String getDBType(){
        return contextHolder.get();
    }

    public static void clearDBType(){
        contextHolder.remove();
    }
}
